package org.csmz.xg2333;

public class User {
    public String name;
    public String id;
    public String agr;

    public User(){
        System.out.println("无构造方法");
    }
    public User(String name,String id,String agr){
        this();//this调用无构造方法
        this.agr = agr;
        this.id = id;
        this.name = name;
        this.print();// this调用成员方法
    }
    public void print(){
        System.out.println("姓名是："+name+"学号是："+id+"年龄是"+agr);
    }
}
